﻿using ZingBlog.Dto;

namespace ZingBlog.IService
{
    public interface IBaseService<T> where T:class ,new ()
    {
        #region CRUD
        bool CreateEntity(T model);
        T ReadEntity(int Id);
        bool UpdateEntity(T model);
        bool UpdateEntity(T model, string updateFields);
        bool DeleteEntity(int Id);
        bool DeleteByWhere(string where);
        #endregion
        IEnumerable<T> GetAll(string returnFields = null, string orderby = null);
        dynamic GetListByFilter(T filter, PageInfo pageInfo);
        IEnumerable<T> GetByWhere(string where = null, object param = null, string returnFields = null, string orderby = null);
        IEnumerable<T> GetBySkip(int skip, int take, string returnFields = null, string where = null, object param = null, string orderBy = null);
    }
}
